<template >
    <div>
        mock test
    </div>
</template>
<script setup>
import { onMounted } from 'vue'
import axios from 'axios'
import "@/utils/mock";

onMounted(() => {
    // axios
    //     .get('/api/mockGetList')
    //     .then((res) => {
    //         console.log("模拟数据1", res.data);
    //     })
    //     .catch((err) => {
    //         console.log(err);
    //     });

    axios
        .post('/api/getCharts', {
            firstName: 'Fred',
            lastName: 'Flintstone'
        })
        .then((res) => {
            console.log("模拟数据2", res.data);

            var option;

            option = {
                title: {
                    text: 'Referer of a Website',
                    subtext: 'Fake Data',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    left: 'left'
                },
                series: [
                    res.data.data
                ]
            };
            option && myChart.setOption(option);
        })
        .catch((err) => {
            console.log(err);
        });

})
</script>
<style lang="">
    
</style>